class CreateToolTypes < ActiveRecord::Migration
  def self.up
    create_table :tool_types do |t|
      t.string :name
      t.integer :tools_count, :default => 0
      t.timestamps
    end
    ToolType.create :name => '站长工具' if Rails.env.production?
    add_column :tools, :tool_type_id, :integer, :default => 1
  end

  def self.down
    drop_table :tool_types
    remove_column :tools, :tool_type_id
  end
end
